#include <stdio.h>
#include <conio.h>
#define N 11

void quick_sort(int *,int,int);

void main()
	{
	 int a[N];
	 int p;
	 int i,j;
	 clrscr();
	 for(i=0;i<N;i++)
		{
		 printf("please input a number %d: ",i+1);
		 scanf("%d",&a[i]);
		 if(a[i]==NULL) break;
		 }

   p=i;
   quick_sort(a,0,p-1);

	 printf("Now the numbers are:\n");
	 for(j=0;j<p;j++)
		{
		 printf("%d ",a[j]);
		}
	}

void quick_sort(int *ss,int left,int right)
	{
	 register int i,j;
	 int x,y;
	 i=left;j=right;
	 x=ss[(left+right)/2];
	 do{
		while(ss[i]<x && i<right) i++;
		while(x<ss[j] && j>left) j--;
		 if(i<=j){
			y=ss[i];
			ss[i]=ss[j];
			ss[j]=y;
			i++;j--;
			}
		}while(i<=j);
	 if(left<j) quick_sort(ss,left,j);
	 if(i<right) quick_sort(ss,i,right);
    }